<template>
  <div>
    评论内容：
    <br/><br/>
    <el-input
      type="textarea"
      placeholder="请输入内容"
      v-model="c_detail"
      maxlength="100"
      show-word-limit
    >
    </el-input>
    <div style="margin: 20px 0;"></div>
    评论人：
    <br/><br/>
    <el-input
      style="width: 140px;"
      type="text"
      placeholder="评论人名字"
      v-model="contentUser"
      show-word-limit
    >
    </el-input>
    <el-button @click="onsubmit" type="success">提交评论</el-button>
  </div>
</template>
<style>
</style>
<script>
export default {
  methods: {
    onsubmit () {
      this.$http.get('', {params: {c_detail: this.c_detail, contentUser: this.contentUser}}).then(({data: res}) => {
        if (res > 0) {
          this.$router.push({path: 'newsList'})
        }
      })
    }
  },
  data () {
    return {
      c_detail: '',
      contentUser: ''
    }
  }
}
</script>
